Trò chơi Tic-Tac-Toe, game đánh caro full source code
53.459 lượt xem;
- MessageOverlay.cs
- Scripts /
- DemoPickup /
- Demos /
- Photon Unity Networking /
- Assets /
- project /
1 using UnityEngine;
2 using System.Collections;
3
4 public class MessageOverlay : MonoBehaviour
5 {
6 public GameObject[] Objects;
7
8 public void Start()
9 {
10 SetActive(true);
11 }
12
13 public void OnJoinedRoom()
14 {
15 SetActive(false);
16 }
17
18 public void OnLeftRoom()
19 {
20 SetActive(true);
21 }
22
23 void SetActive(bool enable)
24 {
25 foreach (GameObject o in Objects)
26 {
27 #if UNITY_3_5
28 o.SetActiveRecursively(enable);
29 #else
30 o.SetActive(enable);
31 #endif
32 }
33 }
34 }
2 using System.Collections;
3
4 public class MessageOverlay : MonoBehaviour
5 {
6 public GameObject[] Objects;
7
8 public void Start()
9 {
10 SetActive(true);
11 }
12
13 public void OnJoinedRoom()
14 {
15 SetActive(false);
16 }
17
18 public void OnLeftRoom()
19 {
20 SetActive(true);
21 }
22
23 void SetActive(bool enable)
24 {
25 foreach (GameObject o in Objects)
26 {
27 #if UNITY_3_5
28 o.SetActiveRecursively(enable);
29 #else
30 o.SetActive(enable);
31 #endif
32 }
33 }
34 }